<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link type="text/css" rel="stylesheet" href="<c:url value='/css/estilo.css'/>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InvestmentTracker</title>
</head>
<link type="text/css" href="../css/smoothness/jquery-ui-1.8.9.custom.css"
	rel="stylesheet" />
		<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
		<script type="text/javascript" src="../js/jquery-ui-1.8.9.custom.min.js"></script>
<body id="corpo">
<div id="geral"><!-- 0 -->
<div id="topo"><%@ include file="../include/topo.jsp"%></div>
<!-- 1 -->
<div id="menu"><%@ include file="../include/menu.jsp"%></div>
<!-- 2 -->
<div id="conteudo">
<div id="esquerda"><!-- 3 -->
<div id="info"><%@ include file="../include/lateral.jsp"%></div>
<!-- 7 --></div>
<div id="sub-conteudo">
<script>
	$(function() {
		$( "#dialog" ).dialog();
	});
	</script>
<c:if test="${errors.size() >0 }">
<div id="dialog" title="Erro">
<c:forEach var="error" items="${errors}">
	<fmt:message key="${error.message}" /><br />
</c:forEach>
</div>
</c:if>
<center>
<div id="alignTabCategorias">
<div id="tabela1">
<form action='<c:url value="/categoria/cadastrar"/>' method="post">
<table id="alter" width="300px">
	<tr align="center" class="dif">
		<td colspan="4" class="titulo">Crédito</td>
	</tr>
	<c:forEach items="${creditos}" var="categoria" varStatus="status">
		<c:if test="${status.index%2==1}">
			<tr class="dif">
		</c:if>
		<c:if test="${status.index%2==0}">
			<tr>
		</c:if>
		<td align="center" class="b_esq">${categoria.idCategoria}</td>
		<td align="center">${categoria.nome}</td>
		<td align="center"><a href='<c:url value=""/>'>Editar</a></td>
		<td align="center" class="b_dir"><a href='<c:url value=""/>'>Excluir</a></td>
		</tr>
	</c:forEach>
		<tr class="dif">
		<td>nome</td>
		<td><input type="text" name="categoria.nome" />
		<input type="hidden" name="categoria.tipo" value="CREDITO"/></td>	
		<td colspan="2" align="center"><input type="submit" value="Salvar" /></td>
	</tr>
</table>
</form>
</div>
<div id="tabela2">
<form action='<c:url value="/categoria/cadastrar"/>' method="post">
<table id="alter">
	<tr align="center" class="dif">
		<td colspan="4" class="titulo">Débito</td>
	</tr>
	<c:forEach items="${debitos}" var="categoria" varStatus="status">
		<c:if test="${status.index%2==1}">
			<tr class="dif">
		</c:if>
		<c:if test="${status.index%2==0}">
			<tr>
		</c:if>
		<td align="center" class="b_esq">${categoria.idCategoria}</td>
		<td align="center">${categoria.nome}</td>
		<td align="center"><a href='<c:url value=""/>'>Editar</a></td>
		<td align="center" class="b_dir"><a href='<c:url value=""/>'>Excluir</a></td>
		</tr>
	</c:forEach>
	<tr class="dif">
		<td>nome</td>
		<td><input type="text" name="categoria.nome" />
		<input type="hidden" name="categoria.tipo" value="DEBITO"/></td>	
		<td colspan="2" align="center"><input type="submit" value="Salvar" /></td>
	</tr>
</table>
</form>
</div>
</div>
</center>
</div>
<!-- 4 --></div>
<div id="rodape"><%@ include file="../include/rodape.jsp"%></div>
<!-- 6 --></div>
</body>
</html>